forum

home / developersection / forums / conversion issue from a label to int for an id key

conversion issue from a Label to int for an ID key

Anonymous User 1956 22-Dec-2014

I got problem converting this car id key from a label. Here is the error I am receiving

Unable to cast object of type 'System.Web.UI.WebControls.HiddenField' to type 'System.Web.UI.WebControls.Label'.

Do you have any suggestion to avoid this error ?

Thanks

Label myCarId = (Label)item.FindControl("carId");

iCarId = Convert.ToInt32(myCarId);

Session["carId"] = iCarId;


Updated on 23-Dec-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By